# src/calphad/base.py

from abc import ABC, abstractmethod

from xarray import Dataset


class CalphadBase(ABC):
    """Base class for Calphad Calculators."""

    def __init__(self, tdb_file: str) -> None:
        """Initialize the calculator."""
        self.tdb_file = tdb_file

    @abstractmethod
    def get_species(self) -> list[str]:
        """Returns available speices in the system."""
        pass

    @abstractmethod
    def get_phases(self) -> list[str]:
        """Returns available phases in the system."""
        pass

    @abstractmethod
    def calculate_equilibrium(self, comps_fracts: dict[str, float],
                              phases: list[str],
                              temps: tuple[int, int, int] | list[int],
                              pressure: float = 101325) -> Dataset:
        """Calculate phase equilibrium.

        Args:
            comps_fracts: Components fractions.
            phases: Phases in the system.
            temps: Temperature range.
            pressure: Pressure. Defaults to 101325.

        Returns:
            xr.Dataset: Phase equilibrium data.
        """
        pass
